import React from 'react';
import { Button } from 'antd';

const HOC = (WrapComponent: any) =>
  class Index extends React.Component {
    constructor(props: any) {
      super(props);
      this.state = {
        name: 'alien',
      };
    }
    render() {
      return <WrapComponent {...this.props} {...this.state} />;
    }
  };

function Comp(props: any) {
  console.log(props, '增强属性props');
  return <Button type="primary">change</Button>;
}

const WarpComp = HOC(Comp);

export default WarpComp;
